Page({
  onLoad: function (options) {
    let userInfo = wx.getStorageSync("userInfo")
    this.setData({
      inputVal: userInfo.nickName,
      isFocus: true,
      params: options.params
    })
  },
  data: {
    multiArray: [['青龙职教中心', '山海关铁路技师学院',"安心职教中心"], ["计算机1805","计算机1804"], ['第一期', '第二期',"第三期","第四期"]],
    multiIndex: [0, 0, 0],
  },
  bindMultiPickerChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    const {multiArray} = this.data;
    let achievementCondition = {
      school:multiArray[0][e.detail.value[0]],
      class:multiArray[1][e.detail.value[1]],
      time:multiArray[2][e.detail.value[2]]
    }
    console.log(achievementCondition)
    this.setData({
      multiIndex: e.detail.value
    })
    wx.setStorageSync("achievementCondition", achievementCondition);
    
  },
  bindMultiPickerColumnChange: function (e) {
    console.log('修改的列为', e.detail.column, '，值为', e.detail.value);
    console.log(this.data.multiArray)
    console.log(e.detail)
    var data = {
      multiArray: this.data.multiArray,
      multiIndex: this.data.multiIndex
    };
    data.multiIndex[e.detail.column] = e.detail.value;
    switch (e.detail.column) {
      case 0:
        switch (data.multiIndex[0]) {
          case 0:
            data.multiArray[1] = ["计算机1805","计算机1804","计算机1903","计算机1904"]
            break;
          case 1:
            data.multiArray[1] = ["高职一班","高职二班","计算机4班","计算机5班"];
            break;
          case 2:
            data.multiArray[1] = ["电商高职一班","电商高职二班","电商高职三班"];
            break;
        }
        data.multiIndex[1] = 0;
        data.multiIndex[2] = 0;
        break;
    }
    this.setData(data);
  }
})